import count from '@dfeidao/atom-nodejs/db/count';
import query from '@dfeidao/atom-nodejs/db/query';
interface Message {
	productid: string;
	formid: string; // 功能号
}
// 查询功能定义控制点表
export default async function atom(msg: Message, action_id: string, session_id: string) {
	const { exec, prepare } = query(action_id, session_id, '12');
	prepare('pub_form_code', ['formid', 'code', 'action_keyword', 'action_name'], { productid: msg.productid, formid: msg.formid }, 200, 1, [], []);
	const [data] = await exec();
	// 查询总条数
	const { exec: e, prepare: p } = count(action_id, session_id, '12');
	p('pub_form_code', { productid: msg.productid, formid: msg.formid });
	const [_count] = await e();
	return { dataArray: data, count: _count };
}
